#pragma once

#ifndef __CR_IMAGE_LOADER_LOADER_H__
#define __CR_IMAGE_LOADER_LOADER_H__

NS_CR_BEGIN

namespace image
{
	namespace loader
	{
		using SpTask = _STD shared_ptr<TaskFragment>;

		class CR_DLL Loader
		{
		public:
			Loader();
			~Loader();

			void Init(const Configuration& config);
			void Term();

			Result Load(SpTask&& task);
			_STD future<Result> LoadAsync(SpTask&& task);
		private:
// 			class Impl;
			Result Run(const SpTask& task);
#pragma warning(push)
#pragma warning(disable: 4275 4251)
// 			_STD unique_ptr< Impl > pimpl_;
			_STD unique_ptr<cache::DiskCache>					_cache;
			_STD unique_ptr<thread_pool>						_thread_pool;
#pragma warning(pop)
		public:
			uint32_t getTasksCount() const;
			uint32_t getQueuesCount() const;
		};
	}
}


NS_CR_END


#endif // !__CR_IMAGE_LOADER_LOADER_H__
